package com.karrysong.blog_springboot.util;

import com.karrysong.blog_springboot.entity.User;

/**
 * @ClassName: UserThreadLocal
 * @Author: KarrySong
 * @Date: 2022/8/5 9:02
 * @Description:
 */
public class UserThreadLocal {

    private UserThreadLocal(){}

    private static final ThreadLocal<User> LOCAL = new ThreadLocal<>();

    public static void put(User sysUser){
        LOCAL.set(sysUser);
    }
    public static User get(){
        return LOCAL.get();
    }
    public static void remove(){
        LOCAL.remove();
    }
}
